Network Sustainability Mechanism - ZIP 234 & 235 implementation #8948
+1,931
−557
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR implements ZIP-234 and ZIP-235.
Specifications & References
ZIP-234, ZIP-235
Solution
This PR is implemented above #8930 which implements the ZIP-233. It smoothes the issuance curve (ZIP-234) and introduces the split between miner fees (40%) and the amount that is burned (60%, ZIP-235). Some of the code used in the block semantical verification for block subsidy calculation has been moved into the write task, as now the block subsidy calculation relies on the current amount of
money_reserve
which is obtained from pool value balance atheight-1
- therefore the previous block must be already present at least in the non-finalized best chain.Tests
For testing purposes, a local testnet network was set up. It contained two nodes—a zebra and a zcashd one (with the ZIP-234 & 235 implemented, too, PR zcash/zcash#6970). A transaction in a new format containing the
burn_amount
field was created and added to the block by zcashd. The zebra node synced with zcashd without any errors and accepted the block.A couple of unit tests were also added.
Follow-up Work
PR Author's Checklist
PR Reviewer's Checklist